package com.scau.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.scau.pojo.Admin;

@RestController
public class TestController {

    @RequestMapping("/testIndex")
    public String index(){
    	Admin admin = new Admin();
        admin.setId(2018);
        System.out.println(admin+"-----------------------");
        System.out.println("cwj");
        ObjectMapper jsonMapper = new ObjectMapper();
        String json = "";
		try {
			json = jsonMapper.writeValueAsString(admin);
			
			System.out.println(json);
		} catch (JsonProcessingException e) {
			e.printStackTrace();
			
		}
    return json;
    
    
    }
}
